<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
	<link rel="stylesheet" href="__STATIC__/plugins/fuelux/css/tree-metronic.css" />
</block>

<block name="body">
    
    <!-- 数据表格 -->
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-globe"></i>岗位授权</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <a id="add-group" class="btn green" href="{:U('createGroup')}">新 增</a>
                            <a url="{:U('changestatus',array('method'=>'resumeGroup'))}" class="btn green ajax-post" target-form="ids" >启 用</a>
                            <a url="{:U('changestatus',array('method'=>'forbidGroup'))}" class="btn green ajax-post" target-form="ids" >禁 用</a>
                            <a url="{:U('changestatus',array('method'=>'deleteGroup'))}" class="btn green ajax-post confirm" target-form="ids" >删 除</a>
                            <a url="{:U('reCreateGroup')}" class="btn green ajax-post" target-form="ids" >复 制</a>
                            <a url="{:U('Api/update',array('r'=>'group'))}" class="btn green ajax-post" target-form="ids" >更新缓存</a>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                    <th>用户组</th>
                                    <th>描述</th>
                                    <th>授权</th>
                                    <th>状态</th>
                                    <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                            <volist name="_list" id="vo">
                            <tr class="odd gradeX">
                                <td><input class="checkboxes ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                                <td><a href="{:U('AuthManager/editgroup?id='.$vo['id'])}">{$vo.title}</a> </td>
                                <td><span>{:mb_strimwidth($vo['description'],0,60,"...","utf-8")}</span></td>
                    
                    
                                <td><a href="{:U('AuthManager/access?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >访问授权</a>
                                <a href="{:U('AuthManager/category?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >分类授权</a>
                                <a href="{:U('AuthManager/user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
                                </td>
                                <td>{$vo.status_text}</td>
                                <td><eq name="vo.status" value="1">
                                    <a href="{:U('AuthManager/changeStatus?method=forbidGroup&id='.$vo['id'])}" class="ajax-get">禁用</a>
                                    <else/>
                                    <a href="{:U('AuthManager/changeStatus?method=resumeGroup&id='.$vo['id'])}" class="ajax-get">启用</a>
                                    </eq>
                                    <a href="{:U('AuthManager/changeStatus?method=deleteGroup&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                                    <a href="{:U('AuthManager/reCreateGroup?id='.$vo['id'])}" class="ajax-get">复制</a>
                                    </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
    
                    <div class="page">
                        {$_page}
                    </div>
                    
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/plugins/fuelux/js/tree.js"></script>  
	<!-- END PAGE LEVEL SCRIPTS -->      
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/ui-tree.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>
	<script>
		jQuery(document).ready(function() { 
		   App.init();
		   TableManaged.init();
		});
	</script>
</block>
